

import HrPubCommon from '../../../../hrpub/common/actions';
import ModelAction from '../model/model-action';

export default class CommonAction extends HrPubCommon {

    extend = [ModelAction]
    searchMap = {
        'entry': 'entryQuery',
        'leave': 'dimissionQuery',
        'regular': 'regQuery'
    }

    listMap = {
        'entry': 'entryList',
        'leave': 'dimissionList',
        'regular': 'regList'
    }

    reqData = [{
        rqUrl: '/platform/templet/querypage.do',
        rqJson: `{\n  \"pagecode\": \"600920B0nccloud\",\n  \"appcode\": \"600920B0\"\n}`,
        rqCode: 'template'
    }, {
        rqUrl: '/platform/appregister/queryallbtns.do',
        rqJson: `{\n  \"pagecode\": \"600920B0nccloud\",\n  \"appcode\": \"600920B0\"\n}`,
        rqCode: 'button'
    }, {
        rqUrl: '/platform/appregister/queryappcontext.do',
        rqJson: `{\n  \"appcode\": \"600920B0\"}`,
        rqCode: 'context'
    }];

    update = async (obj) => {
        await this.comp.props.dispatch({
            type: 'sca/update',
            payload: obj
        });
    }
}